package com.agmte.api.app.entity.pojo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.List;

@Data
public class ApiMapper {

    @NotBlank(message = "mapper定义名称不能为空")
    @ApiModelProperty("mapper定义名称")
    private String name;

    @NotBlank(message = "mapper定义编码不能为空")
    @ApiModelProperty("mapper定义编码")
    private String code;

    @ApiModelProperty("响应类型,0列表，1对象，2分页")
    private int responseType;

    @NotBlank(message = "mapper定义语句不能为空")
    @ApiModelProperty("mapper中select标签语句")
    private String mapperSql;

    @Valid
    @ApiModelProperty("参数列表")
    List<ApiParamInfo> paramInfos;

    public ApiMapper() {
        this.paramInfos = new ArrayList<>();
    }
}
